package com.example.daytest.collection;

import com.example.daytest.exceltosql.ExcelBean;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author heyu
 * @title: CollectionTest
 * @description:java集合测试
 * @date 2021/5/13下午2:58
 */
public class CollectionTest {

  public static void main(String[] args) {
    ExcelBean e = new ExcelBean();
    e.setAge("18");
    e.setCity("571");
    List list = new ArrayList<>();
    ExcelBean e2 = new ExcelBean();
    e2.setAge("19");
    e2.setCity("575");
    ExcelBean e3 = new ExcelBean();
    e3.setAge("18");
    e3.setCity("570");
    list.add(e);
    list.add(e2);
    list.add(e3);

    Iterator<ExcelBean> iterator = list.iterator();
    while (iterator.hasNext()) {
      ExcelBean sbi = iterator.next();
      sbi.setCity("799");
    }

    System.out.println();
  }
}
